import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '@/views/layout/index.vue'

Vue.use(VueRouter)

// 引入业务子模块
import customerPhotoComponent from '@/router/modules/customerPhoto'
import noticeComponent from '@/router/modules/notice'
import aboutComponent from '@/router/modules/about'

const routes = [
	{
		path: '/',
		name: 'homePage',
		title: '首页',
		component: Layout,
		children: [
			{
				path: '',
				component: () => import('@/views/index')
			},
			{
				path: '/photoAlbum',
				component: () => import('@/views/photoAlbum/index')
			},
		]
	},
	{
		path: '/customerPhoto',
		name: 'customerPhoto',
		title: '客片欣賞',
		component: Layout,
		children: customerPhotoComponent
	},
	{
		path: '/notice',
		name: 'notice',
		title: '拍摄须知',
		component: Layout,
		children: noticeComponent
	},
	{
		path: '/about',
		name: 'about',
		title: '关于我们',
		component: Layout,
		children: aboutComponent
	}
]

const router = new VueRouter({
	routes
})

export default router
